
import request from '@/utils/request'

const api = {
  create: '/t1/point/rectify',
  lists: '/t1/point/rectify_list',
  edit: '/t1/point/rectify',
  update: '/t1/point/rectify_update',
  action_list: '/t1/point/action_list',
  changeStatus: '/t1/point_option/change_status',
  del: '/t1/point/rectify_delete',
  info: '/t1/point_option/info',
  rectifyInfo: '/t1/point/rectify_info'
}

// 积分选项
export function listsFile (parameter) {
  return request({
    url: api.lists,
    method: 'get',
    Headers: { responseType: 'blob' },
    responseType: 'blob',
    params: parameter
  })
  // const a = document.createElement('a')
  // a.href = listsFile
  // a.download = '你所起的文件名.xls'
  // a.click()
}
// 积分选项
export function lists (parameter) {
  return request({
    url: api.lists,
    method: 'get',
    params: parameter
  })
}

export function actionaList (parameter) {
  return request({
    url: api.action_list,
    method: 'get',
    params: parameter
  })
}

export function rectifyInfo (parameter) {
  return request({
    url: api.rectifyInfo,
    method: 'get',
    params: parameter
  })
}

// 积分选项
export function info (parameter) {
  return request({
    url: api.info,
    method: 'get',
    params: parameter
  })
}
// 创建积分选项
export function create (parameter) {
  return request({
    url: api.create,
    method: 'post',
    data: parameter
  })
}
// 编辑积分选项
export function edit (parameter) {
  return request({
    url: api.edit,
    method: 'post',
    data: parameter
  })
}
// 修改状态
export function changeStatus (parameter) {
  return request({
    url: api.changeStatus,
    method: 'post',
    data: parameter
  })
}

// 删除
export function del (parameter) {
  return request({
    url: api.del,
    method: 'post',
    data: parameter
  })
}

// 编辑
export function update (parameter) {
  return request({
    url: api.update,
    method: 'post',
    data: parameter
  })
}
